package my.suveng.oauth2.model.enums;

import cn.hutool.core.util.ArrayUtil;

import java.util.TreeMap;

public enum StatusEnums {
    //
    UP(0, "up"), DOWN(1, "down");

    private static TreeMap<Integer, String> MAP = new TreeMap<>();

    static {
        StatusEnums[] values = StatusEnums.values();
        if (ArrayUtil.isNotEmpty(values)) {
            for (StatusEnums value : values) {
                MAP.put(value.key, value.value);
            }
        }

    }

    StatusEnums(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    private Integer key;

    private String value;

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public TreeMap<Integer, String> getMap() {
        return MAP;
    }
}
